home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / graphics / plotter.arj / PLOTTER.DOC < prev    next >
Text File  |  1993-08-06  |  4KB  |  67 lines

  1.  
  2.                              PLOTTER
  3.  
  4.       This is a simple program for graphing functions y = f(x,z). Input
  5.  to the program is a file containing values of y in planes perpendicular
  6.  to the z-axis. These data points are first subjected to a rotation around
  7.  the y-axis through an angle of theta degrees, then around the x-axis through
  8.  alpha degrees. Then they are projected onto the xy-plane parallel to the
  9.  z-axis, and the projected coordinates are scaled so that the graph will fill
  10.  the viewing window.
  11.  
  12.       The 'floating horizon' method of hidden line elimination is used; the
  13.  specific algorithm is a slight modification of that given in D. F. Rogers'
  14.  book, Procedural Elements for Computer Graphics, New York, 1985. A few sample
  15.  data files, FUNC0, FUNC1, ... FUNC9, are included. The file FUNC.LST contains
  16.  the functions and values used in calculating these data files.
  17.  
  18.       Operation of the program itself is essentially self-explanatory. After
  19.  a data file is specified and loaded, a description of the function and the
  20.  default view angles is given at the bottom of the screen; you may either plot
  21.  the graph as loaded (by pressing Return or P), load a new file by pressing L,
  22.  or change the viewing angles by pressing V. After displaying the graph, the
  23.  program waits for a keypress, then offers the user a chance to choose new
  24.  viewing angles (in the range -45 to 45 degrees) or to select a new data file.
  25.  (If an input window is open, Esc cancels any input already made and closes
  26.  the window; from the main menu bar, Esc ends the program.)
  27.  
  28.       The program MKDATA, which was used to create the sample files, can be
  29.  used to make additional data files, provided an ANSI C compiler is available.
  30.  To do this, edit MAKEDATA.C, changing the function f() as desired, then
  31.  compile and run the resulting program. You will be asked to enter the
  32.  following information:
  33.     filename  [for output file; no check for existing file is made]
  34.     title     [at most 70 characters]
  35.     x- and z-ranges (Xmin, Xmax, Zmin, Zmax)
  36.     number of x- and z-divisions (numX, numZ)  [maximum 101]
  37.     default values of theta and alpha          [range -45 to 45]
  38.  After this, the file will be written, and you will be given an opportunity to
  39.  run the program again, with the same function but different choices of the
  40.  above options. As noted below, there is a great advantage in speed of
  41.  operation if numX and numZ are each one more than a multiple of 5; for most
  42.  functions, 51 is a reasonable value for numX and numZ, but functions with
  43.  steep ascents or descents may need larger values (the maximum is 101).
  44.  
  45.      An ASCII data file may also be used; it takes longer to load and requires
  46.  more disk space, but can be created and modified with an ordinary editor. It
  47.  MUST have the extension '.ASC', and the first line (which may be empty except
  48.  for a carriage return) should contain the title. This should be followed by:
  49.                1. the number of x-values and the number of z-values
  50.                2. the x-values, from smallest to largest
  51.                3. the z-values, from smallest to largest
  52.                4. the y-values, listed in order of z-value, x-value:
  53.                         y[xmin][zmin] ... y[xmax][zmin]
  54.                         .
  55.                         .
  56.                         y[xmin][zmax] ... y[xmax][zmax]
  57.                 5. the default viewing angles, in degrees (optional)
  58.  
  59.  The numeric data items should be separated by white space only.
  60.  
  61.  Turbo C source code is included:
  62.  PLOTTER must be linked with HLPLOT (and GRAPHICS.LIB)
  63.  MKDATA is a stand alone program.
  64.  
  65.   B. J. Ball    3304 Glen Rose Drive    Austin, TX 78731
  66.  
  67.